# for 循环计算字符串 'a-bc-12----3' 中有多少个字符'-'
# str = 'a-bc-12----3'
# num = []
# for n in str:
#     if n == '-':
#         num += n
#         continue
# print(num.count('-'))

# 或者
# str = 'a-bc-12----3'
# i = 0
# for n in str:
#     if n == '-':
#         i += 1
#         continue
# print(i)
n=0
str = 'a-bc-12----3'
for i in str:
    if i=='-':
        n+=1
print(n)
